<template>
    <div class='contentUi'>
        <span class="label">{{label}}</span>
        <div class="components">
            <el-select v-model="classes" placeholder="请选择"  clearable >
                <el-option
                    v-for="item in classesoptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                ></el-option>
            </el-select>
            </el-form>
        </div>
    </div>
</template>

<script>
import {mapState,mapMutations} from 'vuex';
import {classesoptions} from '@/static/js/select_data.js';
   export default {
    data() {
        return {
            label: '班级',
            
            classes:"",
        }
    },
    computed: {
        classesoptions(){
            return classesoptions;
        },
        //测试
        ...mapState({
            getInput_class:state=>state.pubilcModule.input_class
        })
    },
    watch: {
        classes(){
            this.setInput_class(this.classes);
        },
        getInput_class(){
            //监听重置
            if(this.getInput_class === ''){
                this.classes = '';
            }
        },
    },
    methods: {
        ...mapMutations({
            setInput_class:'pubilcModule/setInput_class'
        })
    },
   }

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>


</style>
